package com.chenjingbing.web.controller;

import com.google.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 首页，boot搭建测试
 * @author jingbing.chen
 */
@Controller
@RequestMapping("/index")
public class IndexController {

    private final static Logger logger = LoggerFactory.getLogger(IndexController.class);










    @RequestMapping("/lists")
    @ResponseBody
    public List<String> lists(){
         try{
             ArrayList<String> ret = Lists.newArrayList("测试1", "测试2", "测试3");
             logger.info("【请求的数据为】,{}",new Date());
             InputStream inputStream=null;
             return ret;
         }catch(Exception exception){
             logger.error("error: "+exception);
             return null;
         }
    }







}
